home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / dbase / kf2ex.lha / KingFisher-Distribution / Install-KingFisher < prev    next >
Text File  |  1996-04-25  |  17KB  |  445 lines

  1. ; Installer Script for KingFisher Release 2
  2. ; Copyright © 1994,1995,1996 Udo Schuermann
  3. ; All rights reserved
  4. ; $VER: Install-KingFisher 2.23 (25.4.96)
  5. ;
  6. ;
  7. ; Installer and Installer project icon
  8. ; (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
  9. ; Reproduced and distributed under license from Commodore.
  10. ; INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  11. ; NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  12. ; OR RESPONSIBILITY IS ASSUMED.
  13.  
  14.  
  15. ; set language=national language
  16. (procedure install-language (
  17.   (set catDest ("KFDEST:Catalogs/%s" language))
  18.   (if (not (exists catDest))
  19.     (makedir catDest (safe)))
  20.   (set src (tackon filepath ("Catalogs/%s/KingFisher.catalog" language)))
  21.   (if (not (exists src))
  22.     (set src ("%s.gz" src)))
  23.   (copyfiles (source src) (dest catDest))
  24.   (if (= (".gz" (substr src (- (strlen src) 3))))
  25.      (run ("stack 50000\nram:gunzip >NIL: <NIL: -r \"%s\"" (tackon catDest "KingFisher.catalog.gz"))))
  26.   (set copied (+ copied (getsize (tackon catDest "KingFisher.catalog"))))
  27.   (if (> copied total) (set total copied))
  28.   (complete (/ (* copied 100) total))
  29. ))
  30.  
  31. ; call w/in foreach loop:
  32. ; always:overwrite?; workinfo=general description; @each-name=name
  33. (procedure condcopy (
  34.   (set cond-copied 0)
  35.   (set doit 1)
  36.   (set fname (tackon "KFDEST:" @each-name))
  37.   (if (= always 0)
  38.     (if (exists fname)
  39.        (set doit 0)))
  40.   (if doit (
  41.     (working ("\nInstalling KingFisher Release 2\n\n%s\n\n%s" workinfo @each-name))
  42.     (copyfiles (source (tackon filepath @each-name)) (dest "KFDEST:"))
  43.     (if (= (".gz" (substr @each-name (- (strlen @each-name) 3)))) (
  44.        (set fname (substr @each-name 0 (- (strlen @each-name) 3)))
  45.        (working ("\nInstalling KingFisher Release 2\n\n%s\n\n%s" workinfo fname))
  46.        (run ("stack 50000\nram:gunzip >NIL: <NIL: -f \"%s\"" (tackon "KFDEST:" @each-name)))))
  47.     (set cond-copied 1)))
  48.   (set copied (+ copied (getsize (tackon "KFDEST:" fname))))
  49.   (if (> copied total) (set total copied))
  50.   (complete (/ (* copied 100) total))
  51. ))
  52.  
  53. ; view only once; from current 'filepath'
  54. (procedure viewreadme (
  55.   (if (= ViewInfo 1) (
  56.     (if (> (run ("run SYS:Utilities/MultiView %sReadme" filepath)) 0)
  57.     (if (> (run ("run SYS:Utilities/AmigaGuide %sReadme" filepath)) 0)
  58.       (run ("run more %sReadme" filepath))))))
  59.   (set ViewInfo 0)
  60. ))
  61.  
  62. ; Main Entry Point
  63. (set dosver (/ (getversion "dos.library" (resident)) 65536))
  64. (set usr @user-level)
  65. (user 1)
  66. (if (< dosver 37)
  67.   (message
  68.     "KingFisher Release 2 requires at least Kickstart 2.04 (V37) but your "
  69.     "system's Kickstart (ROM software) is too old to support KingFisher!\n\n"
  70.     "It is suggested that you abort the installation and upgrade your "
  71.     "system. KingFisher Release 2 will not function on your computer until "
  72.     "you perform the necessary upgrade."))
  73.  
  74. (set parts 0)
  75. (set defopts 0)
  76. (if (or (exists "KingFisher") (exists "KingFisher.gz"))
  77.   (set defopts (bitor defopts %00001011)))
  78. (if (exists "Catalogs")
  79.   (set defopts (bitor defopts %00000100)))
  80. (if (or (exists "1000Fish.kfdb") (exists "1000Fish.kfdb.gz"))
  81.   (set defopts (bitor defopts %00010000)))
  82. (if (or (exists "Example1.format") (exists "Example1.format.gz"))
  83.   (set defopts (bitor defopts %00100000)))
  84. (foreach "" "gad.#?.image(%|.gz)"
  85.   (set defopts (bitor defopts %01000000)))
  86. (if (exists "Developer")
  87.   (set defopts (bitor defopts %10000000)))
  88.  
  89. (set opts
  90.   (askoptions
  91.     (help (cat
  92.     "Contents:\n"
  93.     " 1) Available archives on Aminet and elsewhere\n"
  94.     " 2) Details on installable components\n\n"
  95.     "«1»\n"
  96.     "KingFisher Release 2 is shipped in as many as three (3) separate archives. All desired "
  97.     "archives should be extracted before installation is begun:\n\n"
  98.     "KingFisher223.lha -- All necessary files for KingFisher Release 2 to function, "
  99.     "except for a database. This file is usually the only one that you need to upgrade if a new "
  100.     "version of KingFisher is released. The "223" in the name refers to KingFisher "
  101.     "Release 2 version 23 (or KingFisher 2.23).\n\n"
  102.     "KingFisher2db.lha -- A complete database of all 1000+ Fish Disks. You rarely, "
  103.     "if ever, need to download and install this file twice. The installer will not overwrite an "
  104.     "already installed database, regardless if the database is available or not.\n\n"
  105.     "KingFisher2ex.lha -- Miscellaneous files for KingFisher, including the "
  106.     "KingFisher Developer Kit, button images, ARexx example files, search and custom format "
  107.     "example files, etc. This file is occasionally updated to reflect changes and additions "
  108.     "(especially to the server software, and thus, to the Developer Kit), but this file is, in "
  109.     "general, fairly static.\n\n"
  110.     "«2»\n"
  111.     "Depending on what you have available on disk or in the current directory, you may choose "
  112.     "to install any or all of the following components:\n\n"
  113.     "KingFisher Release 2 -- Except for a database, all you need to run KingFisher.\n\n"
  114.     "Online Documentation -- AmigaGuide® formatted hypertext, designed especially for KS3.x or "
  115.     "later versions of the operating system.\n\n"
  116.     "Language Catalogs -- Operate KingFisher in a language other than English.\n\n"
  117.     "RexxFisher -- Access KingFisher's databases from any program with the help of this ARexx "
  118.     "interface to the server.\n\n"
  119.     "Miscellaneous Files -- Search results and alternate display / print / export format files.\n\n"
  120.     "Button Images -- Example images to replace some or all of KingFisher's 28 interface buttons.\n\n"
  121.     "Developer Kit -- Source code and examples to get you started using the KingFisher Database "
  122.     "Server API in your own projects."))
  123.     (default defopts)
  124.     (prompt (cat
  125.     "The following portions are available for installation. Items not "
  126.     "initially checked are unavailable in this distribution. Press HELP "
  127.     "for additional information."))
  128.     (choices
  129.     "KingFisher Release 2 . .  (~210K)"
  130.     "Online Documentation . .  (~255K)"
  131.     "Language Catalogs  . . (each ~8K)"
  132.     "RexxFisher + Examples  . . (~42K)"
  133.     "1000+ Fish Database  . . (~2200K)"
  134.     "Miscellaneous files  . .  (~100K)"
  135.         "Button images  . . . . . . (~15K)"
  136.     "Developer Kit  . . . . .  (~330K)"
  137.     )))
  138.  
  139. (if (and (or (in opts 0) (in opts 1) (in opts 3)) (not (or (exists "KingFisher") (exists "KingFisher.gz")))) (
  140.   (set opts (bitxor opts %1011))
  141.   (message
  142.     "The KingFisher / KFServer / RexxFisher software is not available in this distribution.\n\nIf "
  143.     "you downloaded the distribution from a BBS or Aminet, you need to also download the file "
  144.     "'KingFisher223.lha'.")))
  145.  
  146. (if (and (in opts 2) (not (exists "Catalogs"))) (
  147.   (set opts (bitxor opts %100))
  148.   (message
  149.     "No language catalogs are available in this distribution.\n\nIf you downloaded the distribution "
  150.     "from a BBS or Aminet, you also need to download the file 'KingFisher2.lha'.")))
  151.  
  152. (if (and (in opts 4) (not (or (exists "1000Fish.kfdb") (exists "1000Fish.kfdb.gz")))) (
  153.   (set opts (bitxor opts %10000))
  154.   (message
  155.     "The '1000 Fish Database' is not available in this distribution.\n\nIf you downloaded the "
  156.     "distribution from a BBS or Aminet, you also need to download the file 'KingFisher2db.lha'.")))
  157.  
  158. (if (and (in opts 5) (not (or (exists "Example1.format") (exists "Example1.format.gz")))) (
  159.   (set opts (bitxor opts %100000))
  160.   (message
  161.     "The miscellaneous example files and button images are not part of this distribution.\n\nIf "
  162.     "you downloaded the distribution from a BBS or Aminet, you also need to download the file "
  163.     "'KingFisher2ex.lha'.")))
  164.  
  165. (set foo 0)
  166. (foreach "" "gad.#?.image(%|.gz)"
  167.   (set foo 1))
  168. (if (and (in opts 6) (= foo 0)) (
  169.   (set opts (bitxor opts %1000000))
  170.   (message
  171.     "Button images to demonstrate the replacement of KingFisher's own buttons are not included "
  172.     "in this distribution.\n\nIf you downloaded the distribution from a BBS or Aminet, you also "
  173.     "need to download the file 'KingFisher2ex.lha'.")))
  174.  
  175. (if (and (in opts 7) (not (exists "Developer"))) (
  176.   (set opts (bitxor opts %10000000))
  177.   (message
  178.     "The Developer Kit is not available in this distribution.\n\nYou need to either download "
  179.     "the file 'KingFisher2ex.lha' or request the developer kit from the author, either as "
  180.     "part of a paid upgrade on disk or free via email.\n\nPlease see the doocumentation for "
  181.     "ordering information!")))
  182.  
  183. (if (= opts 0) (
  184.   (complete 100)
  185.   (message "Looks like the Installer has nothing to do...")
  186.   (exit)))
  187.  
  188. (user usr)
  189.  
  190. (if (in opts 1)
  191.   (if (< dosver 39)
  192.      (set WrapIt
  193.        (askbool
  194.       (prompt (cat
  195.         "»»---> ATTENTION - READ THIS! <---««\n\n"
  196.         "The KingFisher2.guide documentation that ships with "
  197.         "KingFisher Release 2 is formatted with long lines to "
  198.         "provide Kickstart 3.x users with more readable, and "
  199.         "better formatted documentation.\n"
  200.         "THIS FORMAT CAUSES SERIOUS TROUBLE for AmigaGuide "
  201.         "under Kickstart 2.x wherefore a special 'WrapGuide' "
  202.         "tool is supplied to fix the .guide file for use with "
  203.         ("your installed version of AmigaDOS V%ld\n\n" dosver)
  204.         "You are STRONGLY URGED to have Installer apply "
  205.         "the WrapGuide operation to the documentation!!"))
  206.       (choices "WRAPGUIDE" "Skip it")
  207.       (default "WRAPGUIDE")
  208.       (help @askbool-help)))
  209.      (set WrapIt
  210.        (askbool
  211.       (prompt (cat
  212.         "The KingFisher2.guide documentation that ships with "
  213.         "KingFisher Release 2 is formatted with long lines to "
  214.         "provide Kickstart 3.x users with more readable, "
  215.         "paragraph oriented documentation.\n\n"
  216.         "If you have pressing reasons to convert this file "
  217.         "to a version that will not cause trouble with Kickstart "
  218.         "2.x, then you may choose to have the Installer apply "
  219.         "the supplied 'WrapGuide' tool to the file.\n\n"
  220.         "For best performance under your installed version of "
  221.         ("AmigaDOS %ld, it is RECOMMENDED TO SKIP THIS STEP!" dosver)))
  222.       (choices "WrapGuide" "SKIP IT")
  223.       (default "SKIP IT")
  224.       (help @askbool-help)))))
  225.  
  226. (set defcats 0)
  227. (set catalogs 0)
  228. (if (exists "Locale:Catalogs/Dansk")
  229.   (set defcats (bitor defcats 1)))
  230. (if (exists "Locale:Catalogs/Deutsch")
  231.   (set defcats (bitor defcats 2)))
  232. (if (exists "Locale:Catalogs/Español")
  233.   (set defcats (bitor defcats 4)))
  234. (if (exists "Locale:Catalogs/Nederlands")
  235.   (set defcats (bitor defcats 8)))
  236. (if (exists "Locale:Catalogs/Suomi")
  237.   (set defcats (bitor defcats 16)))
  238. (if (exists "Locale:Catalogs/Svenska")
  239.   (set defcats (bitor defcats 32)))
  240.  
  241. (if (and (in opts 2) (<> defcats 0)) (
  242.   (set catalogs
  243.     (askoptions
  244.       (help @askoptions-help)
  245.       (default defcats)
  246.       (prompt (cat
  247.     "Choose any combination of the language catalogs listed below. Those "
  248.     "initially checked are your choices when you installed AmigaOS:")
  249.       (choices
  250.     "Dansk"
  251.     "Deutsch"
  252.     "Español"
  253.     "Nederlands"
  254.     "Suomi"
  255.     "Svenska"
  256.       ))))
  257.    (set CATCOUNT 0)
  258.    (if (in catalogs 0) (set CATCOUNT (+ CATCOUNT 1)))
  259.    (if (in catalogs 1) (set CATCOUNT (+ CATCOUNT 1)))
  260.    (if (in catalogs 2) (set CATCOUNT (+ CATCOUNT 1)))
  261.    (if (in catalogs 3) (set CATCOUNT (+ CATCOUNT 1)))
  262.    (if (in catalogs 4) (set CATCOUNT (+ CATCOUNT 1)))
  263.    (if (in catalogs 5) (set CATCOUNT (+ CATCOUNT 1)))))
  264.  
  265. (set MINSPC 0)
  266. (if (in opts 0) (set MINSPC (+ MINSPC 210)))
  267. (if (in opts 1) (set MINSPC (+ MINSPC 255)))
  268. (if (in opts 2) (set MINSPC (+ MINSPC (* CATCOUNT 8))))
  269. (if (in opts 3) (set MINSPC (+ MINSPC 42)))
  270. (if (in opts 4) (set MINSPC (+ MINSPC 2200)))
  271. (if (in opts 5) (set MINSPC (+ MINSPC 100)))
  272. (if (in opts 6) (set MINSPC (+ MINSPC 15)))
  273. (if (in opts 7) (set MINSPC (+ MINSPC 330)))
  274.  
  275. (set DISKFREE 0)
  276. (while (< DISKFREE MINSPC) (
  277.   (set DESTIN (tackon
  278.     (askdir
  279.       (prompt (cat
  280.     "Where do you wish to install KingFisher Release 2?\n"
  281.     "(A drawer named 'KingFisher2' will be created there.)"))
  282.       (help @askdir-help)
  283.       (default "SYS:"))
  284.     "KingFisher2"))
  285.   (set @default-dest DESTIN)
  286.   (set @execute-dir DESTIN)
  287.   (set DISKFREE (/ (getdiskspace ("%s:" (getdevice DESTIN))) 1024))
  288.   (if (< DISKFREE MINSPC)
  289.     ((if (= @user-level 0) (user 1))
  290.      (if (askbool
  291.     (prompt (cat
  292.         ("\nPlease note:\n\nThe selected volume reports only %ldK of " DISKFREE)
  293.         ("diskspace, whereas you should have at least %ldK free!\n\n" MINSPC)
  294.         "Are you sure you wish to proceed with installation to this volume?"))
  295.     (choices "Yes, proceed" "No, try another")
  296.     (default "No, try another")
  297.     (help @askbool-help))
  298.     (set DISKFREE MINSPC))))))
  299.  
  300. (user 1)
  301. (message ("KingFisher Release 2 will be installed to the directory\n\n%s" DESTIN))
  302. (user usr)
  303.  
  304. (if (not (exists DESTIN))
  305.     (makedir DESTIN (infos) (safe)))
  306.  
  307. (makeassign "KFINST")
  308. (makeassign "KFDEST")
  309. (makeassign "KF2-Inst-1")
  310. (makeassign "KF2-Inst-2")
  311.  
  312. (if (or (exists "KingFisher") (exists "KingFisher.gz"))
  313.   (makeassign "KF2-Inst-1" "" (safe)))
  314. (if (or (exists "1000Fish.index") (exists "1000Fish.index.gz"))
  315.   (makeassign "KF2-Inst-2" "" (safe)))
  316. (makeassign "KFINST" "" (safe))
  317. (makeassign "KFDEST" DESTIN (safe))
  318.  
  319. (copyfiles (source "KFINST:gunzip") (dest "ram:"))
  320. (if WrapIt (copyfiles (source "KFINST:WrapGuide") (dest "ram:")))
  321.  
  322. (complete 0)
  323.  
  324. (set total (* MINSPC 1024))
  325. (set copied 0)
  326. (set ViewInfo 1)
  327.  
  328. (set filepath "KF2-Inst-1:")
  329.  
  330. ; don't show unregistered info if keyfile present
  331. (foreach "KF2-Inst-1:" ".KingFisher.key(%|.gz)"
  332.   (set ViewInfo 0))
  333. (if (exists "KFDEST:.KingFisher.key")
  334.   (set ViewInfo 0))
  335.  
  336. (if (in opts 0) (
  337.   (set workinfo "KingFisher Database Software")
  338.   (set always 1)
  339.   (foreach "KF2-Inst-1:" "(KingFisher|KFServer)(%|.gz)"
  340.     (condcopy))
  341.   (set always 0)
  342.   (foreach "KF2-Inst-1:" "(KingFisher.info|KFServer.prefs)(%|.gz)"
  343.     (condcopy))
  344.   (foreach "KF2-Inst-1:" ".KingFisher.key(%|.gz)"
  345.     (condcopy))))
  346.  
  347. (if (in opts 1) (
  348.   (set workinfo "AmigaGuide® Online Documentation")
  349.   (set always 1)
  350.   (foreach "KF2-Inst-1:" "KingFisher2.guide(%|.gz)"
  351.     (condcopy)
  352.     (if cond-copied (
  353.       (if (or (<= dosver 38) WrapIt)
  354.         ((working "\nWord-wrapping KingFisher2.guide\nfor use with AmigaGuide V34")
  355.          (run ("stack 50000\nram:WrapGuide %s 65" "KFDEST:KingFisher2.guide")))))))
  356.   (foreach "KF2-Inst-1:" "KingFisher2.guide.info(%|.gz)"
  357.     (condcopy)
  358.     (if cond-copied (
  359.       ((if (>= dosver 39)
  360.         ((working "Adjusting KingFisher2.guide icon for MultiView")
  361.          (tooltype
  362.            (dest "KFDEST:KingFisher2.guide")
  363.            (setdefaulttool "MultiView"))))))))
  364.   (foreach "KF2-Inst-1:" "History(%|.gz)"
  365.     (condcopy))
  366.   (foreach "KF2-Inst-1:" "#?IFF(%|.gz)"
  367.     (condcopy))))
  368.  
  369. (if (in opts 2) (
  370.   (working ("\nInstalling KingFisher Release 2\n\nLanguage Catalogs"))
  371.   (if (not (exists "KFDEST:Catalogs"))
  372.       (makedir "KFDEST:Catalogs" (safe)))
  373.   (if (in catalogs 0)    ((set language "Dansk")        (install-language)))
  374.   (if (in catalogs 1)    ((set language "Deutsch")    (install-language)))
  375.   (if (in catalogs 2)    ((set language "Español")    (install-language)))
  376.   (if (in catalogs 3)    ((set language "Nederlands")    (install-language)))
  377.   (if (in catalogs 4)    ((set language "Suomi")        (install-language)))
  378.   (if (in catalogs 5)    ((set language "Svenska")    (install-language)))))
  379.  
  380. (if (in opts 3) (
  381.   (set workinfo "RexxFisher and Examples")
  382.   (set always 1)
  383.   (foreach "KF2-Inst-1:" "RexxFisher(%|.gz)"
  384.     (condcopy))
  385.   (set always 0)
  386.   (foreach "KF2-Inst-1:" "#?.kfrx(%|.gz)"
  387.     (condcopy))))
  388.  
  389. (if (in opts 5) (
  390.   (set workinfo "Miscellaneous Example Files")
  391.   (set always 0)
  392.   (foreach "KF2-Inst-1:" "Example#?.format(%|.gz)"
  393.     (condcopy))
  394.   (foreach "KF2-Inst-1:" "#?.search(%|.gz)"
  395.     (condcopy))
  396.   (foreach "KF2-Inst-1:" "(%|.)Product-Info(%|.gz)"
  397.     (condcopy))))
  398.  
  399. (if (in opts 6) (
  400.   (set workinfo "Demonstration Button Images")
  401.   (set always 0)
  402.   (foreach "KF2-Inst-1:" "gad.#?.image(%|.gz)"
  403.     (condcopy))))
  404.  
  405. (if (in opts 7) (
  406.   (set workinfo "KingFisher Developer Kit")
  407.   (copyfiles (source "KF2-Inst-1:Developer") (dest "KFDEST:Developer") (all))
  408.   (run ("stack 50000\nram:gunzip >NIL: <NIL: -rf Developer"))))
  409.  
  410. (if (in opts 4) (
  411.   (set workinfo "1000 Fish Database")
  412.   (set always 0)
  413.   (foreach "KF2-Inst-1:" "1000Fish.kfdb(%|.gz)"
  414.     (condcopy))
  415.   (set filepath "KF2-Inst-2:")
  416.   (askdisk
  417.     (prompt "\nPlease insert the disk labeled\n\n\"KingFisher Disk 2\"")
  418.     (dest "KF2-Inst-2")
  419.     (help (cat
  420.     "The requested disk contains the '1000 Fish Database' which is installed "
  421.     "as the default database. KingFisher may not function as desired if you "
  422.     "do not install this database.\n\nIf you do not want this database you "
  423.     "may terminate the Installation process. Bewarned that some cleanup "
  424.     "procedures will be omitted in that case, but this is nothing serious."))
  425.     (assigns))
  426.   (working "\nContinuing installation...")
  427.   (viewreadme)
  428.   (foreach "KF2-Inst-2:" "1000Fish#?.(data|index)(%|.gz)"
  429.     (condcopy))))
  430.  
  431. (viewreadme)
  432.  
  433. (complete 100)
  434.  
  435. (delete "ram:gunzip")
  436. (delete "ram:WrapGuide")
  437.  
  438. (makeassign "KFDEST")
  439. (makeassign "KFINST")
  440. (makeassign "KF2-Inst-1")
  441. (makeassign "KF2-Inst-2")
  442.  
  443. (exit)
  444.